-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(storage): use OrderedDict while encoding POST policy #95
Conversation
"expiration": policy_expires.isoformat() + "Z", | ||
}.items() | ||
) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expiration
sometimes encoded before conditions
- in such a cases tests are failing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little concerned about imposing order in signing code given it's only used for conformance tests.
However, it doesn't change the outcome of expectation and will work as expected as a user.
out_data = test_data["policyOutput"] | ||
|
||
decoded_policy = base64.b64decode(fields["policy"]).decode("unicode_escape") | ||
assert decoded_policy == out_data["expectedDecodedPolicy"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved decoded_policy
assert to the top: if something gone wrong in policy, it'll be easier to see it in decoded state - probably will save some time on debugging
@frankyn, kokoro failed in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, one side note. Thanks @IlyaFaer
"expiration": policy_expires.isoformat() + "Z", | ||
}.items() | ||
) | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little concerned about imposing order in signing code given it's only used for conformance tests.
However, it doesn't change the outcome of expectation and will work as expected as a user.
* use OrderedDict() while encoding POST policy * fix(storage): use OrderedDict() while encoding POST policy
* use OrderedDict() while encoding POST policy * fix(storage): use OrderedDict() while encoding POST policy
Towards #64 (comment)
Sometimes policy losses it's order while encoding into JSON. Adding
OrderedDict()
to fix this.